home *** CD-ROM | disk | FTP | other *** search
/ FishMarket 1.0 / FishMarket v1.0.iso / fishies / 151-175 / disk_166 / stevie / source / help.c < prev    next >
C/C++ Source or Header  |  1992-05-06  |  9KB  |  312 lines

  1. /*
  2.  * STEVIE - Simply Try this Editor for VI Enthusiasts
  3.  *
  4.  * Code Contributions By : Tim Thompson           twitch!tjt
  5.  *                         Tony Andrews           onecom!wldrdg!tony 
  6.  *                         G. R. (Fred) Walter    watmath!watcgl!grwalter 
  7.  */
  8.  
  9. #include "stevie.h"
  10.  
  11. char           *Version = "STEVIE - Version 3.10a";
  12.  
  13. static int      helprow;
  14.  
  15. #ifdef    HELP
  16.  
  17. #ifdef    MEGAMAX
  18. overlay "help"
  19. #endif
  20.  
  21. static void     longline();
  22.  
  23. bool_t
  24. help()
  25. {
  26.  
  27.     /***********************************************************************
  28.          * First Screen:   Positioning within file, Adjusting the Screen
  29.          ***********************************************************************/
  30.  
  31.     outstr(T_ED);
  32.     windgoto(helprow = 0, 0);
  33.  
  34.     longline("\
  35.    Positioning within file\n\
  36.    =======================\n\
  37.       ^F             Forward screenfull             Worked on by:\n\
  38.       ^B             Backward screenfull                Tim Thompson\n");
  39.     longline("\
  40.       ^D             scroll down half screen            Tony Andrews\n\
  41.       ^U             scroll up half screen              G.R. (Fred) Walter\n");
  42.     longline("\
  43.       G              Goto line (end default)\n\
  44.       ]]             next function\n\
  45.       [[             previous function\n\
  46.       /re            next occurence of regular expression 're'\n");
  47.     longline("\
  48.       ?re            prior occurence of regular expression 're'\n\
  49.       n              repeat last / or ?\n\
  50.       N              reverse last / or ?\n\
  51.       %              find matching (, ), {, }, [, or ]\n");
  52.     longline("\
  53. \n\
  54.    Adjusting the screen\n\
  55.    ====================\n\
  56.       ^L             Redraw the screen\n\
  57.       ^E             scroll window down 1 line\n\
  58.       ^Y             scroll window up 1 line\n");
  59.     longline("\
  60.       z<RETURN>      redraw, current line at top\n\
  61.       z-             ... at bottom\n\
  62.       z.             ... at center\n");
  63.  
  64.     windgoto(0, 52);
  65.     longline(Version);
  66.  
  67.     windgoto(helprow = Rows - 2, 47);
  68.     longline("<Press space bar to continue>\n");
  69.     windgoto(helprow = Rows - 1, 47);
  70.     longline("<Any other key will quit>");
  71.  
  72.     if (vgetc() != ' ')
  73.     return TRUE;
  74.  
  75.     /***********************************************************************
  76.          * Second Screen:   Character positioning
  77.          ***********************************************************************/
  78.  
  79.     outstr(T_ED);
  80.     windgoto(helprow = 0, 0);
  81.  
  82.     longline("\
  83.    Character Positioning\n\
  84.    =====================\n\
  85.       ^              first non-white\n\
  86.       0              beginning of line\n\
  87.       $              end of line\n\
  88.       h              backward\n");
  89.     longline("\
  90.       l              forward\n\
  91.       ^H             same as h\n\
  92.       space          same as l\n\
  93.       fx             find 'x' forward\n");
  94.     longline("\
  95.       Fx             find 'x' backward\n\
  96.       tx             upto 'x' forward\n\
  97.       Tx             upto 'x' backward\n\
  98.       ;              Repeat last f, F, t, or T\n");
  99.     longline("\
  100.       ,              inverse of ;\n\
  101.       |              to specified column\n\
  102.       %              find matching (, ), {, }, [, or ]\n");
  103.  
  104.     windgoto(helprow = Rows - 2, 47);
  105.     longline("<Press space bar to continue>\n");
  106.     windgoto(helprow = Rows - 1, 47);
  107.     longline("<Any other key will quit>");
  108.  
  109.     if (vgetc() != ' ')
  110.     return TRUE;
  111.  
  112.     /***********************************************************************
  113.          * Third Screen:   Line Positioning, Marking and Returning
  114.          ***********************************************************************/
  115.  
  116.     outstr(T_ED);
  117.     windgoto(helprow = 0, 0);
  118.  
  119.     longline("\
  120.     Line Positioning\n\
  121.     =====================\n\
  122.     H           home window line\n\
  123.     L           last window line\n\
  124.     M           middle window line\n");
  125.     longline("\
  126.     +           next line, at first non-white\n\
  127.     -           previous line, at first non-white\n\
  128.     CR          return, same as +\n\
  129.     j           next line, same column\n\
  130.     k           previous line, same column\n");
  131.  
  132.     longline("\
  133. \n\
  134.     Marking and Returning\n\
  135.     =====================\n\
  136.     ``          previous context\n\
  137.     ''          ... at first non-white in line\n");
  138.     longline("\
  139.     mx          mark position with letter 'x'\n\
  140.     `x          to mark 'x'\n\
  141.     'x          ... at first non-white in line\n");
  142.  
  143.     windgoto(helprow = Rows - 2, 47);
  144.     longline("<Press space bar to continue>\n");
  145.     windgoto(helprow = Rows - 1, 47);
  146.     longline("<Any other key will quit>");
  147.  
  148.     if (vgetc() != ' ')
  149.     return TRUE;
  150.     /***********************************************************************
  151.          * Fourth Screen:   Insert & Replace, 
  152.          ***********************************************************************/
  153.  
  154.     outstr(T_ED);
  155.     windgoto(helprow = 0, 0);
  156.  
  157.     longline("\
  158.     Insert and Replace\n\
  159.     ==================\n\
  160.     a           append after cursor\n\
  161.     i           insert before cursor\n\
  162.     A           append at end of line\n\
  163.     I           insert before first non-blank\n");
  164.     longline("\
  165.     o           open line below\n\
  166.     O           open line above\n\
  167.     rx          replace single char with 'x'\n\
  168.     R           replace characters (not yet)\n\
  169.     ~           replace character under cursor with other case\n");
  170.  
  171.     longline("\
  172. \n\
  173.     Words, sentences, paragraphs\n\
  174.     ============================\n\
  175.     w           word forward\n\
  176.     b           back word\n\
  177.     e           end of word\n\
  178.     )           to next sentence (not yet)\n\
  179.     }           to next paragraph (not yet)\n");
  180.     longline("\
  181.     (           back sentence (not yet)\n\
  182.     {           back paragraph (not yet)\n\
  183.     W           blank delimited word\n\
  184.     B           back W\n\
  185.     E           to end of W");
  186.  
  187.     windgoto(helprow = Rows - 2, 47);
  188.     longline("<Press space bar to continue>\n");
  189.     windgoto(helprow = Rows - 1, 47);
  190.     longline("<Any other key will quit>");
  191.  
  192.     if (vgetc() != ' ')
  193.     return TRUE;
  194.  
  195.     /***********************************************************************
  196.          * Fifth Screen:   Misc. operations, 
  197.          ***********************************************************************/
  198.  
  199.     outstr(T_ED);
  200.     windgoto(helprow = 0, 0);
  201.  
  202.     longline("\
  203.     Undo  &  Redo\n\
  204.     =============\n\
  205.     u           undo last change\n\
  206.     U           restore current line (not yet)\n\
  207.     .           repeat last change\n");
  208.  
  209.     longline("\
  210. \n\
  211.     File manipulation\n\
  212.     =================\n");
  213.     longline("\
  214.     :w          write back changes\n\
  215.     :wq         write and quit\n\
  216.     :x          write if modified, and quit\n\
  217.     :q          quit\n\
  218.     :q!         quit, discard changes\n\
  219.     :e name     edit file 'name'\n");
  220.     longline("\
  221.     :e!         reedit, discard changes\n\
  222.     :e #        edit alternate file\n\
  223.     :w name     write file 'name'\n");
  224.     longline("\
  225.     :n          edit next file in arglist\n\
  226.     :n args     specify new arglist (not yet)\n\
  227.     :rew        rewind arglist\n\
  228.     :f          show current file and lines\n");
  229.     longline("\
  230.     :f file     change current file name\n\
  231.     :ta tag     to tag file entry 'tag'\n\
  232.     ^]          :ta, current word is tag");
  233.  
  234.     windgoto(helprow = Rows - 2, 47);
  235.     longline("<Press space bar to continue>\n");
  236.     windgoto(helprow = Rows - 1, 47);
  237.     longline("<Any other key will quit>");
  238.  
  239.     if (vgetc() != ' ')
  240.     return TRUE;
  241.  
  242.     /***********************************************************************
  243.          * Sixth Screen:   Operators, Misc. operations, Yank & Put
  244.          ***********************************************************************/
  245.  
  246.     outstr(T_ED);
  247.     windgoto(helprow = 0, 0);
  248.  
  249.     longline("\
  250.     Operators (double to affect lines)\n\
  251.     ==================================\n\
  252.     d           delete\n\
  253.     c           change\n");
  254.     longline("\
  255.     <           left shift\n\
  256.     >           right shift\n\
  257.     y           yank to buffer\n");
  258.  
  259.     longline("\n\
  260.     Miscellaneous operations\n\
  261.     ========================\n\
  262.     C           change rest of line\n\
  263.     D           delete rest of line\n\
  264.     s           substitute chars\n");
  265.     longline("\
  266.     S           substitute lines (not yet)\n\
  267.     J           join lines\n\
  268.     x           delete characters\n\
  269.     X           ... before cursor\n");
  270.  
  271.     longline("\n\
  272.     Yank and Put\n\
  273.     ============\n\
  274.     p           put back text\n\
  275.     P           put before\n\
  276.     Y           yank lines");
  277.  
  278.     windgoto(helprow = Rows - 1, 47);
  279.     longline("<Press any key>");
  280.  
  281.     vgetc();
  282.  
  283.     return TRUE;
  284. }
  285.  
  286. static void
  287. longline(p)
  288.     char           *p;
  289. {
  290. # ifdef AMIGA
  291.     outstr(p);
  292. # else
  293.     char           *s;
  294.  
  295.     for (s = p; *s; s++) {
  296.     if (*s == '\n')
  297.         windgoto(++helprow, 0);
  298.     else
  299.         outchar(*s);
  300.     }
  301. # endif
  302. }
  303. #else
  304.  
  305. bool_t
  306. help()
  307. {
  308.     msg("Sorry, help not configured");
  309.     return FALSE;
  310. }
  311. #endif
  312.